﻿<%@ Page Language="C#" AutoEventWireup="true" 
CodeBehind="ComparativoEditForm.aspx.cs" 
Inherits="UILGestion.ObraAdmin.ComparativoEditForm" %>

<%@ Register Assembly="CustomControls" Namespace="CustomControls" TagPrefix="cc2" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="lib" %>

<%@ Register assembly="EstandarControl" namespace="EstandarControl" tagprefix="cc1" %>
<%@ Register src="../../Control/menuObraCtrl.ascx" tagname="menuObraCtrl" tagprefix="uc1" %>

<%@ Import Namespace="System.Web.Script.Services" %>
<%@ Import Namespace="System.Web.Services" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <link href="../../css/main.css" rel="stylesheet" type="text/css" />

    <title>EDITAR COMPARATIVO</title>
    <script src="../../Scripts/Util.js" type="text/javascript"></script>
    <script src="../../Scripts/Comparativo.js" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/fonts.css" />
 <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/global.css" />
 <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/theme.css" />
 
 
    <style type="text/css">
        .style1
        {
            height: 17px;
        }
    </style>
 
 
</head>
     <script type="text/javascript" >
         

   
    </script>
<body>
    
    <form id="form1" runat="server" autocomplete="off">
    
    <uc1:menuObraCtrl ID="menuObraCtrl1" runat="server" />
    
    
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnableScriptGlobalization="true"  
     EnablePartialRendering="true"></asp:ToolkitScriptManager>
    
  
     
 <asp:Panel ID="pnlMain" runat="server" Visible="false" CssClass="Heading secTitle AreaHeading ms-crm-List-Header " >
                 <asp:Label ID="Label1" runat="server" Text="EDITAR COMPARATIVO" style="font-size: large; color: #960818"></asp:Label>
 </asp:Panel>
 <asp:Panel ID="PanelButtom" runat="server" Visible="false"    class="ms-crm-Form-Body" >
 <table >
<tr>

<td>
    <asp:Button ID="saveButton" runat="server" Text="Guardar"  CssClass="ms-crm-List-Header"  OnClientClick="return confirm('Usted quiere Guardar el Comparativo?')"
       OnClick="btnContinue_OnClick"     /></td>
<td>
    <asp:Button ID="cancelarButton" runat="server" Text="Cancelar"  CssClass="ms-crm-List-Header"
       OnClick="btnContinue_OnClick" Width="80px" /></td>
        <td>
        <asp:Button ID="RestablecerButton" runat="server" Text="Restablecer"  CssClass="ms-crm-List-Header"
       OnClick="btnContinue_OnClick" Width="80px" />
        
        </td>

        <td>
        <asp:Button ID="EliminarButton" runat="server" Text="Eliminar"  CssClass="ms-crm-List-Header"
         OnClientClick="return confirm('Usted quiere eliminar el Comparativo?')" 
       OnClick="btnContinue_OnClick" Width="80px" />
        
        </td>

        <td>

                          <asp:LinkButton ID="LinkButton2" runat="server"></asp:LinkButton>
                                

                                <asp:LinkButton ID="LinkButton4" runat="server"></asp:LinkButton><asp:LinkButton 
                ID="LinkButton6" runat="server">
                                </asp:LinkButton>
                
                
                </td><td>
            

            <asp:LinkButton ID="LinkButton1" runat="server" Text=""></asp:LinkButton>
                             

                             </td><td>
            

           </td></tr>
            </table>
                             
                            
                 
                 </asp:Panel>

       
             <asp:Panel ID="PanelBody" runat="server" Visible="false" BackColor="white" >
                                   
                              
     <asp:UpdatePanel ID="CabeceraUpdatePanel" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
               <input id="tipoCambioUtilizado" runat="server" type="hidden" /> 
    <table>
    <tr>
    <td class="style14">
    <table >
          <tr>
              <td align="right" width="100px" >
                        Codigo:</td>
              <td >
                  <asp:Label ID="numDocumentoTextBox" runat="server"></asp:Label>
              
              </td> 
              

               <td  align="right">Obser. IGV:</td>




              <td>
                  <asp:Label ID="IncluyeIGVLabel" runat="server" Text=""></asp:Label>
              </td>
              <td align="right" rowspan="5" valign="top">
                  <asp:UpdatePanel ID="panelTotal" runat="server" UpdateMode="Conditional">
                      <ContentTemplate>
                          <table class="PanelTotales">
                              <tr>
                                  <td>
                                      MONTO BASE:</td>
                                  <td align="right" width="100px">
                                      <asp:Label ID="totalBaseTextBox" runat="server" Text=""></asp:Label>
                                  </td>
                                  <tr>
                                      <th>
                                          <asp:Label ID="proveedor1LBL" runat="server" Text=""></asp:Label>
                                      </th>
                                      <td align="right" width="100px">
                                          <asp:Label ID="total1TXT" runat="server" Text=""></asp:Label>
                                          <br />
                                      </td>
                                  </tr>
                                  <tr>
                                      <td>
                                          <asp:Label ID="proveedor2LBL" runat="server" Text=""></asp:Label>
                                      </td>
                                      <td align="right" width="100px">
                                          <asp:Label ID="total2TXT" runat="server" Text=""></asp:Label>
                                      </td>
                                  </tr>
                              </tr>
                              <tr>
                                  <td>
                                      <asp:Label ID="proveedor3LBL" runat="server" Text=""></asp:Label>
                                  </td>
                                  <td align="right">
                                      <asp:Label ID="total3TXT" runat="server" Text=""></asp:Label>
                                  </td>
                              </tr>
                          </table>
                      </ContentTemplate>
                  </asp:UpdatePanel>
              </td>




          </tr>
          <tr>
              <td align="right">
                  Fecha:</td>
              <td>
                  <asp:TextBox ID="fechaInsertTextBox" runat="Server" AutoPostBack="true" 
                      BackColor="Transparent" ontextchanged="fechaInsertTextBox_TextChanged" 
                      Width="100px"></asp:TextBox>
                  <asp:ImageButton ID="ImageButton1" runat="Server" 
                      AlternateText="Click aqui para mostrar calendario" 
                      ImageUrl="~/Images/month.gif" Width="16px" />
                  <asp:CalendarExtender ID="CalendarExtender2" runat="server" 
                      PopupButtonID="ImageButton1" TargetControlID="fechaInsertTextBox">
                  </asp:CalendarExtender>
              </td>
              <td align="right">
                  Observaciones:</td>
              <td align="right" rowspan="5" valign="top">
                  <asp:TextBox ID="observacionesInsertTextBox" runat="server" 
                      BackColor="Transparent" Height="70px" TextMode="MultiLine" width="200px"></asp:TextBox>
              </td>
          </tr>
          <tr>
              <td align="right" >
                  Partida de Compras:</td>
                         

<td>
    <asp:HyperLink ID="estrcuturaHLNK" runat="server" ForeColor="Blue"></asp:HyperLink>
              </td>
              <td align="right">
               
                  &nbsp;</td>


              

             
          </tr>
            <tr>
              <td align="right" width="100px"  >
                        Descripcion:</td>
              <td >
                            
                  <asp:TextBox ID="descripcionInsertTextBox" runat="server" 
                      BackColor="Transparent" Width="300px"></asp:TextBox>
                            
                </td>
                          
             <td  align="right">&nbsp;</td>
                
          </tr>
          <tr>
          <td align="right" class="style1"  >
              </td>
          <td class="style1" >
              <input type="hidden" runat="server" name="idColeccionList" id="idColeccionList" />
              <input type="hidden" runat="server" name="internalid" id="internalid"  />
              <input type="hidden" runat="server" name="idObra" id="idObra"  />
              <input type="hidden" runat="server" name="idEstructuraCosto" id="idEstructuraCosto"  />
              <input id="idComparativoProveedorList" type="hidden" runat="server" />
              <input id="idMonedaList" type="hidden" runat="server" />
              <input id="idFormaPagoList" type="hidden" runat="server" />
              
              </td>

 
  <td align="right" class="style1" >
              </td>
 
  </tr>
        <tr>
            <td align="right" >
                Moneda:</td>
            <td >
                <asp:DropDownList ID="monedaDropDownList" runat="server" AutoPostBack="True" 
                    onselectedindexchanged="monedaDropDownList_SelectedIndexChanged" Width="132px">
                </asp:DropDownList> <lib:Input ID="tipoCambioContratoLabel" runat="server"  Width="0" ReadOnly="true"/>
                            <lib:Input ID="simbolMonCompLabel" runat="server"  Width="" ReadOnly="true"/>
            </td>
            <td align="right">
                &nbsp;</td>
            <td align="right">
                &nbsp;</td>
        </tr>
     
  </table>
    </td>
    
    </tr>
    </table>                         
  


              </ContentTemplate>
     </asp:UpdatePanel>
   
    <asp:TabContainer ID="TabContainer1" runat="server" Width="100%" ActiveTabIndex="1">
    <asp:TabPanel ID="TabRecursos"    runat="server" HeaderText="Proveedores" 
    >
     
        <ContentTemplate>
            Selecciones proveedores: 
            <asp:UpdatePanel ID="proveedorUpdatePanel" runat="server" 
                UpdateMode="Conditional">
                    <ContentTemplate>
                <asp:GridView ID="proveedorGridView" Runat="Server" 
    SkinID="GridView"
                            DataKeyNames="idInternal" 
                            onrowcancelingedit="CancelProveedorItem" 
                            onrowediting="EditProveedorItem" 
                            OnRowUpdating="UpdateProveedorItem" 
                             OnRowDataBound="RowDataBoundProveedoritem"
                            ShowFooter="True">
                   
                    
                    <Columns>
                        

                    <asp:TemplateField HeaderText="Proveedor" HeaderStyle-HorizontalAlign="Left">
                        

                    <ItemTemplate><asp:Label ID="proveedorLabel" runat="server" BackColor="Transparent" 
                            Text='<%# Eval("descripcion")%>' Width="300px" />
                        </ItemTemplate>
                        
                        

                    <EditItemTemplate>
                        

                   

                     <lib:Input ID="proveedorEditTextBox" runat="server" backcolor="#DFE8F6"  
                            DataType="List" method="GetProveedor" 
                            onchange="javascript:validarProveedorEdit(this);" 
                            OnSelect="SelectProveedorEdit" text='<%# Eval("descripcion")%>' Width="300px" />
                        <lib:Input ID="idproveedorEditTextBox" runat="server" BackColor="Transparent"   
                            ReadOnly="true" Text='<%# Eval("idproveedor")%>' Width="0px" />
                        

                    <lib:Input ID="proveedorEdit1TextBox" runat="server" BackColor="Transparent"   
                            ReadOnly="true" text='<%# Eval("descripcion")%>' Width="0px" />
                         

                        </EditItemTemplate>
                        
                        

                      <FooterTemplate>
                          


                       <lib:Input ID="proveedorInsertTextBox" runat="server"  backcolor="#DFE8F6"   
                              DataType="List" method="GetProveedor" 
                              onchange="javascript:validarProveedorInsert(this);" 
                              OnSelect="SelectProveedorInsert" Width="300px" />
                          
                          
                      <lib:Input ID="idproveedorInsertTextBox" runat="server" ReadOnly="true"   
                              Text='<%# Eval("idproveedor")%>' Width="0" />
                          

                       <lib:Input ID="proveedorInsert1TextBox" runat="server" BackColor="Transparent"   
                              ReadOnly="true" Width="0" />
                          
                        </FooterTemplate>
                        </asp:TemplateField>
                        

                       <asp:TemplateField HeaderText="Forma Pago" HeaderStyle-HorizontalAlign="Left">
                           

                       <ItemTemplate>
                          
                         <asp:Label ID="formaPagoProveedorLabel" runat="server" BackColor="Transparent"   
                                    Text='<%# Eval("formaPago")%>' Width="200px" />
                                                               

                        </ItemTemplate>
                       <EditItemTemplate>
                            
                         <lib:Input ID="formaPagoEditTextBox" runat="server" ReadOnly="true"      Text='<%# Eval("idFormaPago")%>' Width="0px"></lib:Input>
                         <asp:DropDownList ID="formaPagoEditDropDownList" runat="server" Width="200px"  >
                                           </asp:DropDownList>
                        </EditItemTemplate>
                        
                           

                           <FooterTemplate>
                           
                         <%--  <table>--%>
                               

                              <%-- <tr><td>Moneda:</td><td><asp:DropDownList ID="monedaInsertDropDownList" runat="server" Enabled=false 
                                           AutoPostBack="True" Width="200px">
                                       </asp:DropDownList></td></tr>--%>
                               

                            <%--   <tr><td>Forma Pago:</td>--%>
                                   

                                 <%--  <td>--%>
                                   <asp:DropDownList ID="formaPagoInsertDropDownList" runat="server" Width="200px"   >
                                       </asp:DropDownList>
                                   <%--    </td></tr></table>--%>
                        </FooterTemplate>
                        </asp:TemplateField>
                        

                        <asp:TemplateField HeaderText="condicion" HeaderStyle-HorizontalAlign="Left">
                            

                            <ItemTemplate><asp:Label ID="condicionLabel" runat="server" BackColor="Transparent"   
                                    Text='<%# Eval("condicion")%>' Width="300px" />
                        </ItemTemplate>
                        
                            

                            <EditItemTemplate>
                            <asp:TextBox ID="condicionEditTextBox" runat="server" 
                             BackColor="Transparent" Text='<%# Eval("condicion")%>' TextMode="MultiLine"    
                             Width="300px" />
                                

                            </EditItemTemplate>
                        <FooterTemplate>
                            
                                

                                <asp:TextBox ID="condicionInsertTextBox" runat="server"     
                                BackColor="Transparent" TextMode="MultiLine" Width="300px" />
                        </FooterTemplate>
                        </asp:TemplateField>
                        

                        <asp:TemplateField HeaderText="">
                               

                               <ItemTemplate>
                                   

                                </ItemTemplate>
                        </asp:TemplateField>
                        

                        <asp:TemplateField ControlStyle-Width="90px" HeaderText="Total" ItemStyle-HorizontalAlign="Right"><ItemTemplate>
                                

                                <asp:Label ID="totalLabel" runat="server" BackColor="Transparent"   
                                Text='<%# Eval("totalContrMon")%>' Width="75">
                                                </asp:Label>
                        </ItemTemplate>
                          <EditItemTemplate><asp:Label ID="totalEditLabel" runat="server"   
                                BackColor="Transparent" Text='<%# Eval("totalContrMon")%>' Width="75" />
                        </EditItemTemplate>
                        
                            

                            <FooterTemplate><asp:Label ID="totalInsertLabel" runat="server"   
                                    BackColor="Transparent" Text="0.00" Width="75" />
                        </FooterTemplate>
                        </asp:TemplateField>



                     <%--    <asp:TemplateField HeaderText="TC" HeaderStyle-HorizontalAlign="Left">
                        

                    <ItemTemplate><asp:Label ID="proveedocrLabel" runat="server" BackColor="Transparent" 
                            Text='<%# Eval("tipoCambio")%>' Width="300px" />
                        </ItemTemplate>
                        
                        

                  </asp:TemplateField>--%>

                        

                        <asp:CommandField ButtonType="Image" CancelImageUrl="~/Images/cancel.gif" 
                            EditImageUrl="~/Images/edit.gif" ShowEditButton="true" 
                            UpdateImageUrl="~/Images/update.gif" />
         
                         
               

                        <asp:TemplateField >
                            

                            <ItemTemplate>
                            <%--<asp:ImageButton ID="lnkRemove" runat="server" BorderColor="Control"  
                                    CommandArgument='<%# Eval("idInternal")%>' OnClick="DeleteProveedorItem" 
                                    OnClientClick="return confirm('Usted quiere eliminar?')"  ImageUrl="~/Images/delete.gif"   />
--%>


                            <%--<asp:LinkButton ID="lnkRemove" runat="server" BorderColor="Control" 
                                    CommandArgument='<%# Eval("idInternal")%>' OnClick="DeleteProveedorItem" 
                                    OnClientClick="return confirm('Usted quiere eliminar?')" 
                                    Text="&lt;img src=&quot;../Images/delete.gif&quot; /&gt;"></asp:LinkButton>
                            --%>    

                                </ItemTemplate>
                        
                                
                                
 
                            

                                
                                <FooterTemplate>
                                
                                    
 
                                    

                                
                                <asp:Button ID="addProvAdd" runat="server" OnClick="AddProveedorItem" Text="Add" />
                                    

                                 </FooterTemplate>
                        
                                 

                                 </asp:TemplateField>
                                 

                                 </Columns>
                    
                                 

                                 </asp:GridView>
                               
                             
 
                        

                               
                             </ContentTemplate>
                
                             

                             </asp:UpdatePanel>
            
        </ContentTemplate>

</asp:TabPanel>
<asp:TabPanel ID="TabPanel1"    runat="server" HeaderText="Recursos" >
            
            <ContentTemplate>
            <asp:Panel  runat="server" ID="panel234"   >
            <asp:Button ID="AgregarRecursoLinkButton" runat="server" 
                CssClass="ms-crm-List-Header" OnClick="accionItem_Click" 
                Text="Agregar Recurso" />

  <asp:LinkButton ID="LinkButton3" runat="server"></asp:LinkButton>                        


     <asp:modalpopupextender ID="AddRecursoPopup" runat="server" 
                        BackgroundCssClass="modalBackground" cancelcontrolid="CancelAddECItemButton" 
                         RepositionMode="None"                    X="0" Y="0"
                        dropshadow="True" okcontrolid="LinkButton3" popupcontrolid="AddECItemParent" 
                        popupdraghandlecontrolid="AddAddECItem"
                         targetcontrolid="LinkButton1" 
                    DynamicServicePath="" Enabled="True">
                        </asp:modalpopupextender>



            
                <table  >
    <tr>
        <th align="right">
            Leyenda
        </th>
        <tr>
            <td align="right">
                Correcto</td>
            <td>
                <asp:Label ID="Label324" runat="server" BackColor="#009900" Text=" &nbsp; " 
                    Width="35px"></asp:Label>
            </td>
            <td align="right">
                Supero el Limite</td>
            <td>
                <asp:Label ID="Label4" runat="server" BackColor="#CC0000" Text=" &nbsp; " 
                    Width="35px"></asp:Label>
            </td>
        </tr>
         </tr>
    
    </table>
         
            


    </asp:Panel>
                <asp:UpdatePanel ID="panelGrilla" runat="server" UpdateMode="Conditional">
    
                <ContentTemplate>
        

   


       

        <asp:GridView ID="itemGridView" runat="server" 
        SkinID="GridView"
        DataKeyNames="idInternal,totalUso" 
        ShowHeader="true"
        ShowHeaderWhenEmpty="true"
        OnPageIndexChanging="OnPaging" 
        onrowcancelingedit="CancelEditItem"  
        OnRowCreated="ComparativoitemGridView_RowCreated"
        OnRowDataBound="ComparativoitemoGridView_RowDataBound"
        OnRowCommand="ComparativoitemoGridView_RowCommand"
        onrowediting="EditItem" 
        onrowupdating="UpdateItem" 
        ShowFooter="false" 
        onselectedindexchanged="itemGridView_SelectedIndexChanged"    >
        
                 <Columns>
                 
                   <asp:TemplateField  ItemStyle-BackColor="#F2F3F7" ItemStyle-Width="170px"  
                       HeaderStyle-Width="170px">
                 <HeaderTemplate>
                    <asp:Label ID="header0BaseLabel" runat="server" Text="Saldo Actual" ></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate >
                    <table width="100%">
                    <tr><td align="right" width="55px">P.Unit.Ref: </td ><td align="right"> <asp:Label ID="precioBaseLabel" runat="server" Text='<%# Eval("precioBaseMon")%>'       /></td>    </tr>
                    <tr><td align="right">Cantidad:</td><td align="right"><asp:Label ID="Label233" runat="server" Text='<%# Eval("cantidadOrig") %>'  ></asp:Label> </td> </tr>
                    <tr><td align="right">Monto:</td><td align="right"><asp:Label ID="Label3433" runat="server" Text='<%# Eval("totalBaseMonOrig") %>' ></asp:Label> </td> </tr>
                   
                    </table>
                    </ItemTemplate>
                    <EditItemTemplate >
                    <table width="100%">
                    <tr><td align="right" width="55px"> P.Unit.Ref:</td> <td align="right" ><asp:Label ID="precioBaseEditLabel" runat="server" Text='<%# Eval("precioBaseMon")%>'      Width="80px"/></td></tr>
                    <tr><td align="right">Cantidad:</td><td align="right"><asp:Label ID="Label233" runat="server" Text='<%# Eval("cantidadOrig") %>'  ></asp:Label> </td> </tr>
                    <tr><td align="right">Monto:</td><td align="right"><asp:Label ID="Label3433" runat="server" Text='<%# Eval("totalBaseMonOrig") %>' ></asp:Label> </td> </tr>
                   
                    </table>
                    </EditItemTemplate>

                    </asp:TemplateField>




                    <asp:TemplateField HeaderText="Codigo" ControlStyle-Width="80px" HeaderStyle-Width="80px">
                    <ItemTemplate>
                        <asp:Label ID="codigoLabel" runat="server" Text='<%# Eval("codigo")%>' ></asp:Label>
                     </ItemTemplate>
                     <EditItemTemplate>
                     <asp:Label ID="codigoEditTextBox" runat="server" Text='<%# Eval("codigo")%>' ></asp:Label>
                     <lib:Input ID="precioBaseEditTextBox" runat="server" Text='<%# Eval("precioBase")%>'   Width="0px" BackColor="Transparent" ForeColor="Transparent" ReadOnly="true" />
                     <lib:Input ID="totalBaseEditTextBox" runat="server" Text='<%# Eval("totalBaseOrig")%>'  Width="0px" BackColor="Transparent" ForeColor="Transparent" ReadOnly="true" />

                     </EditItemTemplate>
                     
                                      

                                 
                                         
                                         </asp:TemplateField>
                                 
                      <asp:TemplateField HeaderText="Descripcion" ControlStyle-Width="150px" HeaderStyle-Width="150px">
                                     

                                 <ItemTemplate>
                                     

                                     <asp:Label ID="descripcionLabel" runat="server" 
                                         Text='<%# Eval("descripcion")%>' >
                                 </asp:Label>
                                     

                                 </ItemTemplate>
                     
                                     

                                 <EditItemTemplate >
                                     
                                 <asp:Label ID="descripcionEditTextBox" runat="server" 
                                         Text='<%# Eval("descripcion")%>' ></asp:Label>

                                     

                                 </EditItemTemplate>
                     
                                 
                                 
                                 
                                 
                                 
                                     
 
                                     
 
                                     
 
                                     
 
                                     
 
                                     

                                 
                                 
                                 
                                 
                                 
                                 </asp:TemplateField>
                                 

                      <asp:TemplateField HeaderText="Unid." ControlStyle-Width="50px" HeaderStyle-Width="50px">
                                     

                                 <ItemTemplate>
                                     <asp:Label ID="unidadLabel" runat="server" Text='<%# Eval("unidad")%>' />
                                 </ItemTemplate>
                      <EditItemTemplate>
                                <lib:Input ID="unidadEditTextBox" runat="server" BackColor="Transparent"   
                                         ReadOnly="true" Text='<%# Eval("unidad")%>' >
                                 </lib:Input>
                                 
                     </EditItemTemplate>
                     
                                 </asp:TemplateField>


                     <asp:TemplateField HeaderText="" >
                     <ItemTemplate>
                        <%-- <asp:Label ID="ControlRowLabel" runat="server" Text="" ></asp:Label>--%>
                     <%--<asp:RadioButtonList ID="contRadioButtonList" runat="server">
                                <asp:ListItem Text="Por Unidades"  Selected='<%# Eval("bitControlCant")%>' ></asp:ListItem>
                                <asp:ListItem Text="Por Dinero" Selected='<%# !Eval("bitControlCant")%>'></asp:ListItem>
                             </asp:RadioButtonList>--%>
                     </ItemTemplate>
  <EditItemTemplate>
  
<%-- <asp:RadioButtonList ID="controlRadioButtonList" runat="server">
 <asp:ListItem Text="Por Unidades" Value="0"></asp:ListItem>
 <asp:ListItem Text="Por Dinero" Selected="True" Value="1" ></asp:ListItem>
                                     </asp:RadioButtonList>--%>

                       
   </EditItemTemplate>
                 </asp:TemplateField>
                                 
                                  <asp:TemplateField HeaderText="Cantidad" ControlStyle-Width="80px" HeaderStyle-Width="80px">
                                     

                                 <ItemTemplate>
                                     <table>
                                     <tr></tr>
                                      <tr>
                                      <td align="right"><asp:Label ID="cantidadBaseLabel" runat="server" Text='<%# Eval("cantidadBase")%>' Width="80"> </asp:Label> </td>
                                      </tr>
                                     </table>
                                </ItemTemplate>
                     
                                 <EditItemTemplate>
                                     <table >
                                     <tr>
                                        <td align="right">Dispone:</td>
                                        <td><lib:Input ID="cantidadBaseEditTextBox" runat="server"  
                                          BackColor="Transparent" ReadOnly="true"   Text='<%# Eval("cantidadOrig")%>'  Width="80" /></td>
                                     </tr>
                                     <tr>
                                        <td align="right">Uso</td>
                                        <td><cc2:PostTextBox ID="cantidadCompararEditTextBox" runat="server"    DataType="Double"
                                                 onchange="javascript:calcularTotalACompararXCantidadEdit(this);" 
                                              Text='<%# Eval("cantidadBase")%>' Width="80" />

                                               
                                        </td>
                                      </tr>
                                      </table>
                               
                                </EditItemTemplate>
                     
                                 
                                 </asp:TemplateField>
                               
                               <asp:TemplateField HeaderText="" ItemStyle-Width="0px" HeaderStyle-Width="0px"  ControlStyle-Width="0px" >
                                 <ItemTemplate>
                                 <table>
                                                      <tr>
                                                      <td align="right">Precio:</td>
                                                      </tr>
                                                      <tr>
                                                      <td align="right">Total:</td>
                                                      </tr>
                                                      </table>    
                                 </ItemTemplate>
                                 
                               </asp:TemplateField>

                         <%--    <asp:TemplateField HeaderText="Precio Base" ItemStyle-Width="100px">
                                 <ItemTemplate>
                                 
                                </ItemTemplate>
                                <EditItemTemplate>
                                  <table border="2">
                                  <tr> 
                                      <td align="right"><asp:CheckBox ID="totalEditCheckBox" Text="Precio:" runat="server" Width="75px"/>
                                      <td></asp:TextBox> </td>
                                  </tr>
                                  
                                 <tr>
                                     <td align="right">Uso:</td>
                                     <td><asp:TextBox ID="totalBaseEditTextBox" runat="server" BackColor="Transparent" 
                                                         ReadOnly="true" Text='<%# Eval("totalBase")%>' Width="80"></asp:TextBox>
                                      </td>
                                     </tr>
                                 </table>
                                </EditItemTemplate>  
                      </asp:TemplateField>--%>


                           <asp:TemplateField HeaderText="Proveedor 1"  ItemStyle-Width="120px" HeaderStyle-Width="120px">
                         
                               
 
                               

                         
                         <ItemTemplate><table width="100%">
                             

                             <tr><td></td></tr>
                             

                             <tr><td align="right">
                                 

                                 <asp:Label ID="precio1Label" runat="server" BackColor="Transparent" 
                                     Text='<%# Eval("precio1Mon")%>' ></asp:Label></td></tr>
                             

                             <tr><td align="right">
                                             

                                             <asp:Label ID="total1Label" runat="server" BackColor="Transparent" 
                                     Text='<%# Eval("total1Mon")%>' ></asp:Label>
                                             

                                             </td></tr></table>
                     </ItemTemplate>
                     
                                             

                                             <EditItemTemplate>
                                                 

                                             <table border="0">
                                                 

                                             <tr>
                                                 

                                             <td>
                                                 

                                             </td>
                                                 

                                             </tr>
                                                 

                                             <tr><td>
                                             <%--<asp:Label ID="simbol1Label" runat="server" BackColor="Transparent" 
                                             Text='<%Eval(simbol1") %>' Width="0px">--%></asp:Label>
                                             </td></tr>
                                                 

                                             <tr><td>
                                                 

                                              <cc2:PostTextBox ID="precio1EditTextBox" runat="server"   DataType="Double"
                                                     onchange="javascript:calcularTotalProve1XPresioEdit(this);" 
                                                     Text='<%# Eval("precio1")%>' Width="80"/></td></tr>
                                                 

                                                 <tr><td align="right">
                                                     

                                              <cc2:PostTextBox ID="total1EditTextBox" runat="server"   DataType="Double"
                                                         onchange="javascript:calcularPrecioProve1XTotalEdit(this);" 
                                                         Text='<%# Eval("total1")%>' Width="80" /></td></tr>
                                                 

                                             </table>
                                                 

                                             </EditItemTemplate>
                     
                                             

                                             </asp:TemplateField>
                                             
                                             
                                             <asp:TemplateField HeaderText="Proveedor 2"  ItemStyle-Width="120px"
                          HeaderStyle-Width="120px">
                         
                                                 
 
                                                 

                         
                         <ItemTemplate><table width="100%">
                             

                             <tr><td align="right"></td></tr>
                             

                             <tr><td align="right">
                                 

                         <asp:Label ID="precio2Label" runat="server" Text='<%# Eval("precio2Mon")%>' ></asp:Label></td></tr>
                             

                             <tr><td align="right">
                                             

                                             <asp:Label ID="total2Label" runat="server" 
                                     Text='<%# Eval("total2Mon")%>' ></asp:Label></td></tr></table>
                                             
                                             
                                             
 
                             
 
                             

                                             
                                             
                                             </ItemTemplate>
                     
                                                 

                                             <EditItemTemplate>
                                                 

                                             <table border="0">
                                                 

                                             <tr>
                                                 

                                             <td> </td>
                                                 

                                             </tr>
                                                 

                                             <tr><td><%--<asp:Label ID="simbol2Label" runat="server" BackColor="Transparent" 
                                             Text='<%Eval(simbol2") %>' Width="0px"></asp:Label>--%></td></tr>
                                                 

                                             <tr>
                                                 

                                             <td align="right">
                                                 

                                              <cc2:PostTextBox ID="precio2EditTextBox" runat="server"   DataType="Double"
                                                     onchange="javascript:calcularTotalProve2XPresioEdit(this);" 
                                                     Text='<%# Eval("precio2")%>' Width="80"  /></td></tr>
                                                 

                                                 <tr>
                                                     

                                            <td align="right">
                                                

                                              <cc2:PostTextBox ID="total2EditTextBox" runat="server"   DataType="Double"
                                                    onchange="javascript:calcularPrecioProve2XTotalEdit(this);" 
                                                    Text='<%# Eval("total2")%>' Width="80" /></td></tr>
                                                 

                                             </table>
                                                 

                                             </EditItemTemplate>
                     </asp:TemplateField>
                                             
                                             
                           
                                             
                                             
                                             <asp:TemplateField HeaderText="Proveedor 3"  
                          HeaderStyle-Width="120px"  ItemStyle-HorizontalAlign="Right" ><ItemTemplate>
                                                     

                                                     <table width="100%"><tr>
                                                         

                                                         <td align="right"></td></tr><tr>
                                                         

                                                         <td align="right">
                                                             

                         <asp:Label ID="precio3Label" runat="server" Text='<%# Eval("precio3Mon")%>' Width="80"></asp:Label></td></tr>
                                                         

                                                         <tr>
                                                             

                                                         <td align="right">
                                                             

                                             <asp:Label ID="total3Label" runat="server" Text='<%# Eval("total3Mon")%>' Width="80"></asp:Label></td></tr></table>
                     </ItemTemplate>
                     
                                                 

                                             <EditItemTemplate>
                                                 

                                             <table border="0">
                                                 

                                             <tr><td></td>
                                                 

                                             </tr>
                                                 

                                             <tr><td><%--<asp:Label ID="simbol3Label" runat="server" BackColor="Transparent" 
                                             Text='<%Eval(simbol3") %>' Width="0px"></asp:Label>--%></td>
                                                 

                                             </tr>
                                                 

                                             <tr>
                                                 

                                             <td align="right">
                                                 

                                                 <cc2:PostTextBox ID="precio3EditTextBox" runat="server"   DataType="Double"
                                                     onchange="javascript:calcularTotalProve3XPresioEdit(this);" 
                                                     Text='<%# Eval("precio3")%>' Width="80" /></td></tr>
                                                 

                                                 <tr>
                                                     

                                             <td align="right">
                                                 
                                                
                                             <cc2:PostTextBox ID="total3EditTextBox" runat="server"   DataType="Double"
                                                     onchange="javascript:calcularPrecioProve3XTotalEdit(this);" 
                                                     Text='<%# Eval("total3")%>' Width="80" /></td></tr></table>
                     </EditItemTemplate>
                     
                                                 

                                             </asp:TemplateField>
                                             
                                             
                                           
                                             <asp:CommandField 
                                             ButtonType="Image" 
                                           
                         CancelImageUrl="~/Images/cancel.gif" EditImageUrl="~/Images/edit.gif" 
                         ShowEditButton="true"
                            UpdateImageUrl="~/Images/update.gif" />
                         
                         
                         
 
                     
 
                     

                          
                         
                         <asp:TemplateField>
                         <ItemTemplate>
                         

                        
                             <asp:ImageButton ID="lnkRemove" runat="server" BorderColor="Control" 
                             Visible='<%# (Decimal.Parse(Eval("totalUso").ToString()) == 0) ? true : false%> '
                             CommandArgument='<%# Eval("idInternal")%>' OnClick="Deleteitem" 
                             OnClientClick="return confirm('Usted quiere eliminar?')" 
                             ImageUrl="~/Images/delete.gif" />
                             
                        
                             


                             <%--<asp:LinkButton ID="lnkRemove" runat="server" BorderColor="Control" 
                             CommandArgument='<%# Eval("idInternal")%>' OnClick="Deleteitem" 
                             OnClientClick="return confirm('Usted quiere eliminar?')" 
                             Text="&lt;img src=&quot;../Images/delete.gif&quot; /&gt;"></asp:LinkButton>--%>
                             
                             
                     </ItemTemplate>
                     
                             

                             <FooterTemplate>
                                 

                                 <asp:LinkButton ID="btnAdd" runat="server" OnClick="AddNewItem" 
                                     Text="&lt;img src=&quot;../Images/up.gif&quot; /&gt;"></asp:LinkButton>
                                 

                                 <asp:LinkButton ID="cancelLinkButton" runat="server" BorderStyle="None" 
                                     OnClick="AddNewItem" Text="&lt;img src=&quot;../Images/cancel.gif&quot; /&gt;"></asp:LinkButton>
                     </FooterTemplate>
                     </asp:TemplateField>
                     

            </Columns>
            
                    </asp:GridView>
        
        
                    </ContentTemplate>
                    
    
                </asp:UpdatePanel>
                

 


            </ContentTemplate>
            
 
</asp:TabPanel>

</asp:TabContainer>

     </asp:Panel>

                <asp:Panel ID="AddECItemParent" runat="server" CssClass="modalPopup"  Width="800px" >
  <asp:Panel ID="AddAddECItem"   runat="server"   Style="background-color:#DDDDDD;border:solid 1px Gray;color:Black">

     <asp:Panel ID="Panel1" runat="server" CssClass="Heading secTitle AreaHeading ms-crm-List-Header " >
               Seleccionar Recursos
                </asp:Panel>
                <asp:Panel ID="Panel2" runat="server"  class="ms-crm-Form-Body"  >
                
         <asp:UpdatePanel ID="AddECItemUpdatePanel" runat="server" UpdateMode="Conditional">
         <ContentTemplate>
          <input id="ldSortExpression" type="hidden" runat="server"  name="ldSortExpression"/>
       <input id="idAcen" type="hidden" runat="server"  name="idAcen"/>
                  <asp:Panel ID="AddECItem" runat="server"
             Width="100%" 
           
                  >

                        


                 <table>
                 <tr>
  <td width="20%">
      Estructura Compras:</td>
  <td><asp:DropDownList ID="estructuraCostoDropDownList" runat="server"  
          AutoPostBack="true" onselectedindexchanged="estructuraCostoDropDownList_SelectedIndexChanged" 
          Width="100%">
      </asp:DropDownList>
  </td>
  
  </tr>
                 <tr>
                 <td align="right">
                 Moneda:
                 </td>
                 <td>
                     <asp:DropDownList ID="MonedaSeleccionDropDownList" runat="server" AutoPostBack="true"  Width="200" OnSelectedIndexChanged="monedaddl_OnSelectedIndexChanged" >

                     </asp:DropDownList>
                 </td>
                 </tr>
                 </table>
                 <asp:Panel ID="Panel3" runat="server" BackColor="White" 
                       BorderColor="LightSteelBlue" BorderStyle="Solid" BorderWidth="1px"   >
                       
               
                               <cc1:MultiSelectGridView ID="recursoGridView" 
            
            AutoGenerateCheckboxColumn="True"
CellPadding="4" 

BorderColor="LightSteelBlue"
BorderStyle="Solid"
BorderWidth="1px"
GridLines="None"
ShowHeader="true" 
ShowHeaderWhenEmpty="true"
EmptyDataText="No Existe Recursos" 


                CheckboxColumnIndex="0" AllowSorting="True" OnSorting="gridview_sorting"
                runat="server" AutoGenerateColumns="False" DataKeyNames="idInternal" 
                  Width="100%" 
                
                ><EditRowStyle BackColor="#FFFF99" BorderStyle="None" /><FooterStyle BackColor="#FFFF99" BorderStyle="None" /><RowStyle  BackColor="White" BorderStyle="Solid" BorderColor="LightSteelBlue"  BorderWidth="1px"/><HeaderStyle CssClass="ms-crm-List-Header" /><Columns><asp:BoundField DataField="codigo" HeaderText="codigo"  /><asp:BoundField DataField="Descripcion" HeaderText="descripcion"  ItemStyle-Width="450px"/><asp:BoundField DataField="Unidad" HeaderText="unidad"  /><asp:BoundField DataField="CantidadDisp" HeaderText="cantidad" ItemStyle-HorizontalAlign="Right" 
                ItemStyle-Width="75px" /><asp:BoundField DataField="precioMon" HeaderText="precio"  
                ItemStyle-HorizontalAlign="Right" ItemStyle-Width="75px" /><asp:BoundField DataField="totalDispMon" HeaderText="Disponible" 
                 ItemStyle-HorizontalAlign="Right" ItemStyle-Width="75px"/></Columns></cc1:MultiSelectGridView>


        </asp:Panel>
            <asp:Panel ID="Panel18" runat="server"   >
        
<table width="100%" >
 <tr  >
               
                <td class=" ms-crm-Dialog-Footer-Right">
               
                     <asp:Button ID="OkAddECItemButton"  runat="server"  Text="Añadir Seleccion "  CssClass="ms-crm-List-Header"
                      onclick="AddRecurso_Click"    
                       
                        />&nbsp;
                    <asp:Button ID="CancelAddECItemButton"  runat="server" Text="Cancelar" CssClass="ms-crm-List-Header"
                    
                       
                       />&nbsp;
                   
                </td>
   </tr>


   
</table>
        </asp:Panel> 
    
            </asp:Panel>


            </ContentTemplate>
            <Triggers>
            <asp:AsyncPostBackTrigger ControlID="MonedaSeleccionDropDownList" />
            <asp:AsyncPostBackTrigger ControlID="estructuraCostoDropDownList" />
            <asp:AsyncPostBackTrigger ControlID="TabContainer1$TabPanel1$AgregarRecursoLinkButton" />
           
            </Triggers>
         </asp:UpdatePanel>
         </asp:Panel>
      

        </asp:Panel>
          </asp:Panel>
         

    </form>
</body>
</html>
